package com.sunwoda.springbootredis.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @program: springbootredis
 * @description: 获取redis工具类
 * @author: SGR
 * @create: 2021-09-14 10:19
 **/
@Slf4j
@Component
public class RedisBean {

    @Autowired
    private RedisTemplate redisTemplate;

    public static RedisTemplate redis;

    @PostConstruct
    public void getRedisTemplate(){
        redis= this.redisTemplate;
    }
}
